package com.hrm.dao;

import com.hrm.dto.EmpDepDTO;
import com.hrm.dto.EmpScalesRatingDTO;
import com.hrm.dto.StaffPercentBySex;
import com.hrm.dto.StarffPercentByDepartment;
import com.hrm.entity.Employee;
import com.hrm.entity.EmployeeExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface EmployeeMapper {


    /**
     * 根据登录账户查找数据库
     * @param loginName
     * @return: Employee
     */
    Employee selectByName(String loginName);

    /**
     * 根据邮箱查找数据库
     * @param email
     * @return: Employee
     */
    Employee selectByEmail(String email);

    /**
     * 根据电话查找数据库
     * @param phone
     * @return: Employee
     */
    Employee selectByPhone(String phone);

    /**
     * 更新员工信息
     * @param employee
     * @return: int
     */
    int updateEmployee(Employee employee);

    /**
     * 获取带有员工部门的信息
     * @return: List<EmpDepDTO>
     */
    List<EmpDepDTO> empDepList();

    /**
     * 查询员工
     * @param employee
     * @return: List<EmpDepDTO>
     */
    List<EmpDepDTO> queryEmpDepByName(Employee employee);

    List<String> jobTitleList();

    Long countEmp(Integer deptId);

    List<EmpDepDTO> queryEmpDepByDepId(Integer deptId);

    List<Employee> unEmployeeList();

    StaffPercentBySex staffPercent();

    List<StarffPercentByDepartment> staffPercentByDepartment();

    // 逆向工程自动生成
    long countByExample(EmployeeExample example);

    int deleteByExample(EmployeeExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Employee record);

    int insertSelective(Employee record);

    List<Employee> selectByExample(EmployeeExample example);

    Employee selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Employee record, @Param("example") EmployeeExample example);

    int updateByExample(@Param("record") Employee record, @Param("example") EmployeeExample example);

    int updateByPrimaryKeySelective(Employee record);

    int updateByPrimaryKey(Employee record);
}